import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int[] arr = new int[6];
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = scanner.nextInt();
        }
        System.out.println(Arrays.toString(arr));

        //write your code here......
        int j = arr.length-1;
        for (int i =0 ; i <arr.length/2; i++) {
                int tmp = arr[j];
                arr[j] = arr[i];
                arr[i] = tmp;
                j--;
            
        }
    
        System.out.println(Arrays.toString(arr));
    }
}